/*
题目链接 : https://leetcode.cn/problems/find-the-k-beauty-of-a-number/description/?envType=daily-question&envId=2025-03-10
*/

//题解代码:

class Solution {
public:
    int divisorSubstrings(int num, int k) {
        string s = to_string(num);
        int n = s.size();
        int ans = 0;
        for(int i=0,j=k-1;j<n;++i,++j){
            int x = stoi(s.substr(i,j-i+1));
            if(x && num%x==0) ++ans;
        }
        return ans;
    }
};
